﻿using Gnivc.CarDealership.Api.Domain.Primitives;

namespace Gnivc.CarDealership.Api.Domain.Entities;

public class Price : EntityBase
{
    public decimal Value { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime? EndDate { get; set; }

    public Guid VehicleId { get; set; }
    public Vehicle Vehicle { get; set; }

    private Price()
        : base() { }

    public Price(Guid id, decimal value, Vehicle vehicle)
        : base(id)
    {
        Value = value;
        StartDate = DateTime.UtcNow;
        EndDate = null;
        
        Vehicle = vehicle;
        VehicleId = vehicle.Id;
    }
}
